第 5 步:让我们看看每次运行程序时变量label存储的内容。

  • 在“图形”选项卡中,转到并拖入Say
  • .say()中的字符串替换为label

因为我们刚刚使用了字符串连接,所以精灵现在说出了单词 dice 后跟一个数字!

多次运行程序以查看精灵每次所说的差异。

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)